//用户获得他的基本信息
export async function user_GET_info(proxy) {
    try {
        const response = await proxy.$http.post(`/get_user_inf/`);
        if (response.status !== 200)
            throw new Error(`HTTP error! Status: ${response.status}`);

        return response;
    } catch (error) {
        console.error('Error:', error);
        throw error;
    }
}


//用户修改他的基本信息
//注意！这个请求只负责修改昵称、性别、个人签名
export async function user_MODIFY_info(proxy, nickname, sex, sig) {
    try {
        const response = await proxy.$http.post(`/change_user_inf/`,
            {
                nickname: nickname,
                sex: sex,
                sig: sig
            }
        );
        if (response.status !== 200)
            throw new Error(`HTTP error! Status: ${response.status}`);

        return response;
    } catch (error) {
        console.error('Error:', error);
        throw error;
    }
}